class Student{
    fullName: string;
    constructor(public firstName, public middleInitial, public lastName){
        this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
}

interface Person{
    firstName: string;
    lastName: string;
}
/*
function greeter(person: String){
    return "Hello, " + person;
}*/

function greeter(person: Person){
    return "Hello, " + person.firstName + " " + person.lastName;
}

//var user = "Jane User";
//var user = [0, 1, 2];  // person 确认为string 类型后, 传字符串会报错.
//var user = {firstName: "Jane", lastName: "user"};
var user = new Student("Jane", "M.", "User");

document.body.innerHTML = greeter(user);